/* created at 2008-07-07:21:09:21 */
package pl.kwiecienm.jcomet.configuration;

import org.springframework.beans.factory.BeanFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.FileSystemXmlApplicationContext;

/**
 * @author kwiecienm
 */
public class SpringCometConfigurationReader {

    /** */
    private CometConfiguration _cometConfiguration;

    /** */
    public SpringCometConfigurationReader(String configFile) {
        ApplicationContext context = new FileSystemXmlApplicationContext(
                new String[] { configFile });

        // an ApplicationContext is also a BeanFactory (via inheritance)
        BeanFactory factory = context;

        this._cometConfiguration = (CometConfiguration) factory
                .getBean("configuration");
    }

    /**
     * @return the cometConfiguration
     */
    public CometConfiguration getCometConfiguration() {
        return this._cometConfiguration;
    }
}
